# -*- coding: utf-8 -*-
"""
@Project: base_python
@File: jsontest.py
@Author: PC
@Date: 2025/06/19
@Description: 
"""
import json

jsonString = '{"arrayOfNums":[{"number":0},{"number":1},{"number":2}],"arrayOfFruits":[{"fruit":"apple"},{"fruit":"banana"},{"fruit":"pear"}]}\n'
jsonObj = json.loads(jsonString.replace('\n', '').replace(' ', ''))

print(jsonObj.get('arrayOfNums'))
print(jsonObj.get('arrayOfNums')[1])
print(jsonObj.get('arrayOfNums')[1].get('number') +
      jsonObj.get('arrayOfNums')[2].get('number'))
print(jsonObj.get('arrayOfFruits')[2].get('fruit'))
